<!--
 * @FilePath: grafana.vue
 * @@author: wjj
 * @Date: 2025-08-27 19:34:48
 * @@Description: new js file
-->
<template>
  <div class="container" v-if="show">
    <el-link class="card-link" :href="flower_url" target="_blank">
      点击去监控主页
      <template #icon>
        <!-- 使用 iconfont 图标，类名根据你在 iconfont 项目中的设置 -->
        <svg-icon name="home" width="180px" height="180px"></svg-icon>
      </template>
    </el-link>
  </div>
  <div v-else>
    <iframe
      :src="flower_url"
      frameborder="0"
      style="width: 100%; height: 100vh"
    ></iframe>
  </div>
</template>

<script lang='ts' setup >
import { ref, reactive, onMounted, watch, nextTick } from 'vue'
//引入用户相关的小仓库

defineOptions({
  name: 'grafana', //与路由名一致，可使用缓存
})
// 挂载完毕

let show = ref(false)
let flower_url = import.meta.env.VITE_GRA

onMounted(() => {
  console.log(2222)
  if (import.meta.env.VITE_HTTPS_OPEN == 'true') {
    show.value = true
  }
})
//监控数据
//watch(select, (newVal, oldVal) => {})
// let flower_url = 'http://localhost:3000'
// let flower_url =
//   window.location.protocol + '//' + window.location.hostname + ':3000'

console.log()
</script>
<style scoped lang='scss'>
</style>